<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <!-- 搜索统计页面 -->
    <meta charset="UTF-8">
    <title>搜索统计</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <link rel="stylesheet" href="./css/domain.css">
    <!-- 引入jq -->
    <script src="https://cdn.bootcss.com/jquery/3.4.0/jquery.min.js"></script>
    <!-- 引入layui框架 -->
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <!-- 引入xadmin框架 -->
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <!-- 引入请求基准路径 -->
    <script type="text/javascript" src="./js/common.js"></script>
    <!-- <script type="text/javascript" src="./js/domain.js"></script> -->
</head>
<style>
    .layui-row {
        width: 80%;
        margin: 0 auto;
    }

    .layui-table-page {
        text-align: right !important;
    }

    body {
        background-color: #fff !important;
    }
    .user_list1 {
        margin-left: 16px;
        border-left: none !important;
        border-right: none !important;
    }
</style>

<body>
    <div class="x-nav" >
        <!-- <span class="layui-breadcrumb"> -->
        <span class="goods_name">搜索统计</span>
        <!-- </span> -->

        <a class=" layui-btn-small goodsRoload" style="line-height:1.6em;margin-top:3px; " onclick="location.reload()"
            title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i> 刷新
        </a>

    </div>

    <!-- 列表部分 -->
    <div class="layui-fluid" style="margin-top: -20px;">
        <div class="layui-row" style=" border-top: none;">
               <!-- 数据列表 -->
               <div class="user_list1" style="width: 100%;height: 40px;line-height: 40px;padding-left: 20px;background-color: #f2f2f2;box-sizing: border-box;position: relative;top: 40px;border: 1px solid #cccccc;">
                <span style="color: #666; " >关键词排行</span>
            </div>
            <div class="layui-card-body ">
                <!-- 表格部分 -->
                <div style="height: 100vh; width: 100%; border: 1px solid #ccc; padding: 60px 15px; padding-bottom: 0;">
                    <table id="guideListTable" lay-filter="test" style="width: 100%;"></table>
                </div>


            </div>

        </div>
    </div>



    <script>
        //使用layui的方法
        layui.use(['layedit', 'laydate', 'table', 'form'],
            function () {
                // IsTokenSave();
                // var userMessage = JSON.parse(sessionStorage.getItem("user_message"));
                // console.log(userMessage.token)
                var table = layui.table,
                    form = layui.form,
                    layer = layui.layer,
                    layedit = layui.layedit,
                    laydate = layui.laydate;

                $(".refresh_a").click(function () { //返回上一页
                    window.history.go(-1);
                });



                function init() {
                    //第一个实例（创建table）
                    // console.log(JSON.parse(sessionStorage.getItem("token")))
                    table.render({
                        elem: '#guideListTable',
                        // toolbar: '#guideListTableToolbar',
                        id: 'idTest',
                        cellMinWidth: 80,
                        url: urls + 'sales/getSalesList' //数据接口
                        , method: 'get' //如果无需自定义HTTP类型，可不加该参数
                        , headers: {
                            'X-Access-Token': JSON.parse(sessionStorage.getItem("user_message")).token,
                        }
                        , page: true //开启分页
                        , limits: ['20', '30', '50']
                        , limit: 20
                        , parseData: function (res) { //res 即为原始返回的数据
                            //console.log(res)
                            CheckLogout(res);
                            return {
                                "code": res.code, //解析接口状态
                                "msg": res.msg, //解析提示文本
                                "count": res.data.total, //解析数据长度
                                "data": res.data.records //解析数据列表
                            }
                        },
                        cols: [
                            [ //表头
                                {
                                    field: 'account_phone',
                                    title: '商品名称',
                                    align: 'center',
                                }, {
                                    field: 'nickname',
                                    title: '结果',
                                    align: 'center',

                                }, {
                                    field: 'sale',
                                    // edit: 'text',
                                    title: '总搜索',
                                    align: 'center',

                                }, {
                                    field: 'account_phone',
                                    title: '本月',
                                    align: 'center',
                                }, {
                                    field: 'account_phone',
                                    title: '本周',
                                    align: 'center',
                                }, {
                                    field: 'account_phone',
                                    title: '今日',
                                    align: 'center',
                                }, {
                                    field: 'account_phone',
                                    title: '操作',
                                    align: 'center',
                                }
                            ]
                        ],
                        done: function (res, curr, count) {
                            //    重新赋值筛选后的table数量

                        }
                    });
                }
                init();




            })



    </script>
</body>

</html>